package jp.ddo.trismegistos.framework.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import jp.ddo.trismegistos.framework.util.DBConnectionPool;

public class DBInitListener implements ServletContextListener {

	@Override
	public void contextDestroyed(final ServletContextEvent event) {
		DBConnectionPool.getInstance().closeAll();
	}

	@Override
	public void contextInitialized(final ServletContextEvent event) {
		// インスタンスの生成のみ行なっておく
		DBConnectionPool.getInstance(event.getServletContext().getRealPath(
				"/WEB-INF/conf/db.properties"));
	}

}
